import request from './request.js'

const apis = {
	// 获取加密标识
	getMobileCodeEncryption: {
		method: 'post',
		url: '/pay/wlwkUser/checkgetCode',
	},
	// 发送验证码
	sendMobileCode: {
		method: 'post',
		url: '/pay/wlwkUser/getUserCodeNew',
	},
	// 登录（密码）
	loginByPwd: {
		method: 'post',
		url: '/pay/wlwkUser/userLogin',
	},
	// 登录（短信验证码）
	loginByYZW: {
		method: 'post',
		url: '/pay/wlwkUser/register_login',
	},
}

const api_p = new Proxy(apis, {
	get(target, propKey, receiver) {
		let apiConfig = target[propKey]
		return function(params) {
			apiConfig = {
				...apiConfig,
				...params
			}
			return request(apiConfig)
		}
	}
})

export default api_p